package com.example.spider.jsoup;

import org.apache.commons.io.FileUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.io.File;

public class jsoupFile {
    public static void main(String[] args) throws Exception {
        //解析文件
        Document doc = Jsoup.parse(new File("D:\\ideaWorkSpace\\spider\\src\\main\\resources\\jsoupString.html"),"utf-8");
        //提取数据
        String title = doc.getElementsByTag("title").first().text();
        System.out.println(title);

    }
}
